/**
 * 授权 API
 */
import {
	http
} from '../request/main.js';

/**
 * 获取菜品列表
 * 
 * @returns {Promise}
 */
export function getFoodList(group, keyword) {
	return http.post('/food/getFoodList', {
		group,
		keyword
	})
}

/**
 * 获取菜品详情
 * 
 * @returns {Promise}
 */
export function getFoodDetail(id) {
	return http.post('/food/getFoodDetail', {
		id
	})
}

/**
 * 获取收藏列表
 * 
 * @returns {Promise}
 */
export function getLikeList(page, page_size) {
	return http.post('/food/getLikeList', {
		page,
		page_size
	})
}

/**
 * 收藏操作
 * 
 * @returns {Promise}
 */
export function handleLike(food_id, action) {
	return http.post('/food/handleLike', {
		food_id,
		action
	})
}
